<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--		<link rel="stylesheet" type="text/css" href="css/style.css" />-->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>后台管理</title>

		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->

		<!-- text fonts -->
		<link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<!--[if lte IE 9]>
		<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
		<![endif]-->
		<link rel="stylesheet" href="assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		<link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="assets/js/html5shiv.min.js"></script>
		<script src="assets/js/respond.min.js"></script>
		<![endif]-->
	</head>
	<body class="no-skin">
	<div id="navbar" class="navbar navbar-default          ace-save-state"style="margin-top:0px ">
		<div class="navbar-container ace-save-state" id="navbar-container">
			<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
				<span class="sr-only">Toggle sidebar</span>

				<span class="icon-bar"></span>

				<span class="icon-bar"></span>

				<span class="icon-bar"></span>
			</button>

			<div class="navbar-header pull-left">
				<a href="index.html" class="navbar-brand">
					<small>
						<i class="fa fa-leaf"></i>
						华夏医院管理后台
					</small>
				</a>
			</div>


		</div><!-- /.navbar-container -->
	</div>

	<div class="main-container ace-save-state" id="main-container">
		<script type="text/javascript">
			try{ace.settings.loadState('main-container')}catch(e){}
		</script>

		<div id="sidebar" class="sidebar                  responsive                    ace-save-state">
			<script type="text/javascript">
				try{ace.settings.loadState('sidebar')}catch(e){}
			</script>

			<div class="sidebar-shortcuts" id="sidebar-shortcuts">
				<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
					<button class="btn btn-success">
						<i class="ace-icon fa fa-signal"></i>
					</button>

					<button class="btn btn-info">
						<i class="ace-icon fa fa-pencil"></i>
					</button>

					<button class="btn btn-warning">
						<i class="ace-icon fa fa-users"></i>
					</button>

					<button class="btn btn-danger">
						<i class="ace-icon fa fa-cogs"></i>
					</button>
				</div>

				<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
					<span class="btn btn-success"></span>

					<span class="btn btn-info"></span>

					<span class="btn btn-warning"></span>

					<span class="btn btn-danger"></span>
				</div>
			</div><!-- /.sidebar-shortcuts -->

			<ul class="nav nav-list">
				<li class="">
					<a href="index.html">
						<i class="menu-icon fa fa-tachometer"></i>
						<span class="menu-text"> 医院主页 </span>
					</a>

					<b class="arrow"></b>
				</li>

				<li class="">
					<a href="#" class="dropdown-toggle">
						<i class="menu-icon fa fa-desktop"></i>
						<span class="menu-text">
								管理服务
							</span>

						<b class="arrow fa fa-angle-down"></b>
					</a>

					<b class="arrow"></b>

					<ul class="submenu">


						<li class="">
							<a href="./doctorList.html">
								<i class="menu-icon fa fa-caret-right"></i>
								医生管理
							</a>

							<b class="arrow"></b>
						</li>

						<li class="">
							<a href="./patientList.html">
								<i class="menu-icon fa fa-caret-right"></i>
								患者管理
							</a>

							<b class="arrow"></b>
						</li>

						<li class="">
							<a href="./AdminCase.html" >
								<i class="menu-icon fa fa-caret-right"></i>
								病例管理
							</a>

							<b class="arrow"></b>
						</li>

						<li class="">
							<a href="./department.html">
								<i class="menu-icon fa fa-caret-right"></i>
								科室管理
							</a>

							<b class="arrow"></b>
						</li>
						<li class="">
							<a href="./adminRegist.html">
								<i class="menu-icon fa fa-caret-right"></i>
								添加管理员
							</a>

							<b class="arrow"></b>
						</li>
					</ul>
				</li>

				<li class="">
					<a href="#" class="dropdown-toggle">
						<i class="menu-icon fa fa-list"></i>
						<span class="menu-text"> 学习库 </span>

						<b class="arrow fa fa-angle-down"></b>
					</a>

					<b class="arrow"></b>

					<ul class="submenu">
						<li class="">
							<a href="./AdrugList.html">
								<i class="menu-icon fa fa-caret-right"></i>
								药物库
							</a>

							<b class="arrow"></b>
						</li>

						<li class="">
							<a href="./AdeviceList.html">
								<i class="menu-icon fa fa-caret-right"></i>
								器械库
							</a>

							<b class="arrow"></b>
						</li>
					</ul>
				</li>

				<li class="">
					<a href="#" class="dropdown-toggle">
						<i class="menu-icon fa fa-pencil-square-o"></i>
						<span class="menu-text"> 出诊排班 </span>

						<b class="arrow fa fa-angle-down"></b>
					</a>

					<b class="arrow"></b>

					<ul class="submenu">
						<li class="">
							<a href="./schedule.html" target="_blank">
								<i class="menu-icon fa fa-caret-right"></i>
								查询出诊
							</a>

							<b class="arrow"></b>
						</li>



					</ul>
				</li>

				<li class="">
					<a href="./search.html">
						<i class="menu-icon fa fa-list-alt"></i>
						<span class="menu-text"> 智能诊疗方案 </span>
					</a>

					<b class="arrow"></b>
				</li>
				<li class="">
					<a href="./libraryRegist.html">
						<i class="menu-icon fa fa-list-alt"></i>
						<span class="menu-text"> 增加智能诊疗 </span>
					</a>

					<b class="arrow"></b>
				</li>
			</ul>
		</div>



		<div class="row">
			<div class="col-xs-12">
				<!-- PAGE CONTENT BEGINS -->

				<!-- PAGE CONTENT ENDS -->
			</div><!-- /.col -->
		</div><!-- /.row -->
	</div><!-- /.page-content -->

	<div class="page-content"style="position:absolute;margin-left: 400px;margin-top: -160px;" id="wrap">
		<div class="row">
				<button type="button" class="btn btn-success" onclick="location.href='./deviceRegist.html'"style="width:100px;margin-top:-120px;margin-left: 12px" target="_blank">新建器械
				<i class="ace-icon glyphicon glyphicon-plus" style="position:absolute;margin-left:-75px;margin-top: 7px"></i>
				</button>
			<div class="col-xs-12">
							<table class="table table-bordered table-hover bootstrap-table" id="simple-table" style="width:800px;table-layout: fixed;">
								<thead>
								<tr class="table_header">
									<td>
										器械编号
									</td>
									<td>
										器械名称
									</td>
									<td>
										器械规格
									</td>
									<td>
										器械简介
									</td>
									<td>
										器械用法
									</td>

<!--									<td>-->
<!--										options-->
<!--									</td>-->
								</tr>
								</thead>
								<tbody>
								<tr v-for="(emp,index) in devices" :key="emp.id" :class="index%2==0?'row1':'row2'">
									<td>
										{{ emp.id }}
									</td>
									<td>
										{{ emp.name }}
									</td>

									<td>
										{{ emp.telspecification }}
									</td>
									<td style="white-space: nowrap;word-break: keep-all;text-overflow: ellipsis;overflow: hidden;width: 100%;" :title="emp.directions">
										{{ emp.directions }}
									</td>
									<td style="white-space: nowrap;word-break: keep-all;text-overflow: ellipsis;overflow: hidden;width: 100%;" :title="emp.useage">
										{{ emp.useage }}

									</td>

<!--									<td>-->
<!--										<a href="javascript:;" @click="delEmp(emp.id)" class="btn btn-primary active" data-toggle="button" aria-pressed="false">delete</a>&nbsp;<a :href="'/es_healthy/updateDepartment.html?id='+emp.id" class="btn btn-primary active"  aria-pressed="false">update</a>-->
<!--									</td>-->
								</tr>
								</tbody>
							</table>
<!--<a href="http://localhost:8080/es_healthy/updateDoctor.html?id=13"class="btn btn-primary active"  aria-pressed="false">22222</a>-->
						</div>
					</div>
		<div class="row">
			<div class="col-xs-6">
			</div>
			<div class="col-xs-6" style="margin-top:10px;margin-left: 180px;width:500px">
				<a class="btn" href="javascript:;" @click="findAll(page-1)" v-if="page>1">&lt;上一页</a>
				<a class="btn" href="javascript:;"  v-if="page==1"disabled>&lt;上一页</a>
				<a class="btn"href="javascript:;" v-for="indexpage in totalPage"@click="findAll(indexpage)" v-text="indexpage">&nbsp;1</a>&nbsp;&#x0020;
				<a class="btn" v-if="page==totalPage" >下一页&gt;</a>
				<a class="btn" v-if="page<totalPage"@click="findAll(page+1)">下一页&gt;</a>
			</div>
		</div>
				</div>

<script>
	onLoadSuccess: function a() {
		$('.bootstrap-table tr td').each(function () {
			$(this).attr("title", $(this).text());
			$(this).css("cursor", 'pointer');
		});

	}
</script>


	<div class="footer">
		<div class="footer-inner">
			<div class="footer-content">
				<div id="footer">
					<div id="footer_bg">
						Copyright © 小凡哥 All rights reserved.
						li123fan00@foxmail.com
					</div>
				</div>

				&nbsp; &nbsp;
				<span class="action-buttons">
							<a href="#">
								<i class="ace-icon fa fa-twitter-square light-blue bigger-150"></i>
							</a>

							<a href="#">
								<i class="ace-icon fa fa-facebook-square text-primary bigger-150"></i>
							</a>

							<a href="#">
								<i class="ace-icon fa fa-rss-square orange bigger-150"></i>
							</a>
						</span>
			</div>
		</div>
	</div>

	<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
		<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
	</a>
	</div><!-- /.main-container -->

	<!-- basic scripts -->

	<!--[if !IE]> -->
	<script src="assets/js/jquery-2.1.4.min.js"></script>

	<!-- <![endif]-->

	<!--[if IE]>
	<script src="assets/js/jquery-1.11.3.min.js"></script>
	<![endif]-->
	<script type="text/javascript">
		if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
	</script>
	<script src="assets/js/bootstrap.min.js"></script>

	<!-- page specific plugin scripts -->

	<!-- ace scripts -->
	<script src="assets/js/ace-elements.min.js"></script>
	<script src="assets/js/ace.min.js"></script>

	<!-- inline scripts related to this page -->

	</body>

	<script src="/es_healthy/js/vue.js"></script>
	<script src="/es_healthy/js/axios.min.js"></script>
	<script>
		var app = new Vue({
			el:"#wrap",
			data:{
				admin:{},//存放登陆的用户信息
				devices:[],//用来存放员工信息
				page:0,
				rows:4,
				totalPage:0,
				totals:0,
			},
			methods:{
				logout(){
					localStorage.removeItem("admin");
					//刷新页面
					location.reload(true);
				},
				//删除员工信息
				delEmp(id){
					if(window.confirm("确定要删除这条科室信息吗？"))
					{
						var _this = this;
						axios.get("http://localhost:8080/es_healthy/admin/deleteDepartment?id="+id+"&token="+sessionStorage.getItem("token")).then(res=>{
							if(res.data.state){
								alert(res.data.msg+"点击确定刷新数据");
								_this.findAll();//重新加载数据
							}else{
								alert(res.data.msg);
							}
						})
					}

				},

				//查询员工列表方法
				findAll(indexpage){
					if(indexpage){
						this.page=indexpage;
					}
					var _this = this;
					axios.get("http://localhost:8080/es_healthy/admin/deviceList?page="+this.page+"&token="+sessionStorage.getItem("token")).then(res=>{
						_this.devices = res.data.devices;
						_this.page=res.data.page;
						_this.totalPage=res.data.totalPage;
						_this.totals=res.data.totals;
					})
				}

			},
			created(){
				var managerString = localStorage.getItem("manager");
				var role=sessionStorage.getItem("role");
				console.log(managerString);
				if((managerString)&&(role=="admin"))
				{
					//将JSON转化为user对象
					this.user=JSON.parse(managerString);
				}else{
					alert("您尚未登陆,点击确定跳转至登陆页面");
					location.href="/es_healthy/loginAdmin.html";
				}
				//查询所有信息
				this.findAll();

			}
		});
	</script>
</html>
